<?php

declare (strict_types=1);

namespace App\Model;

use Hyperf\Database\Model\Relations\HasOne;

/**
 */
class MomentsApply extends Model
{
    public $timestamps = false;
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'fly_moments_applys';
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [];
    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected $casts = [];

    /**
     * 关联当前动态详情
     * @return HasOne
     */
    public function with_moments_info()
    {
        return $this->hasOne(Moment::class, 'id', 'moments_id')
            ->with(['with_shop']);
    }

    /**
     * 关联话题信息
     * @return HasOne
     */
    public function with_topic_info()
    {
        return $this->hasOne(FlyTopic::class, 'id', 'topic_id');
    }
}